package com.example.proyyj.Service;


import com.example.proyyj.Entity.Chinaware;
import com.example.proyyj.Entity.Collection;
import com.example.proyyj.Impl.CollectionImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CollectionService implements CollectionImpl {

    @Resource//依赖注入
    CollectionImpl collection;

    /**
     * 是否收藏
     * @param userid
     * @param chinawareid
     * @return
     */
    @Override
    public Collection collection(int userid, int chinawareid) {
        return collection.collection(userid, chinawareid);
    }

    /**
     * 文物添加
     * @param userid
     * @param chinawareid
     * @return
     */
    @Override
    public int addchiaware(int userid, int chinawareid) {
        return collection.addchiaware(userid,chinawareid);
    }


    /**
     * 取消收藏
     * @param userid
     * @param chinawareid
     * @return
     */
    @Override
    public int delchiaware(int userid, int chinawareid) {
        return collection.delchiaware(userid, chinawareid);
    }


    /**
     * 查看用户收藏
     * @return
     */
    @Override
    public List<Collection> lookchiawarelist(int userid) {
        return collection.lookchiawarelist(userid);
    }



    @Override
    public Chinaware lookchiaware(int ChinawareId) {
        return collection.lookchiaware(ChinawareId);
    }


}
